<style type="text/css">

body{
	overflow:auto;
}
.barra_flash{
	background-color:#ff00ff;
}
</style>
<?php 
error_reporting(E_ERROR | E_PARSE);

$rss_tags = array('title','link','guid','comments','description','pubDate','category',);
$rss_item_tag = 'item';
$rss_url = 'http://www4.bcb.gov.br/feed/taxas.ashx';

$rssfeed = rss_to_array($rss_item_tag,$rss_tags,$rss_url);

$cont = count($rssfeed);
$c = 0;
$qnt = 0;
$var = 'texto=';
while($c<=$cont){
	$title = strip_tags($rssfeed[$c]['title']);
	$description = strip_tags($rssfeed[$c]['description']);
	$var .= $title.' '.$description.' ';
	$qnt = $qnt + strlen($title);
	$qnt = $qnt + strlen($description);
	++$c;
}
$var = str_replace('&agrave;s','-', $var);
$var = str_replace('Compra','Compra ', $var);
$var = str_replace('Venda',' Venda ', $var);
$var = str_replace('em',' em', $var);
$var = str_replace('Em',' Em', $var);
$var = str_replace('Taxa',' Taxa', $var);

$var = html_entity_decode($var);
$qnt = $qnt+8;

function rss_to_array($tag, $array, $url) {
	$doc = new DOMdocument();
	$doc->load($url);
	$rss_array = array();
	$items = array();
	foreach($doc->getElementsByTagName($tag) AS $node) {
		foreach($array AS $key => $value) {
			$items[$value] = $node->getElementsByTagName($value)->item(0)->nodeValue;
		}
		array_push($rss_array, $items);
	}
	return $rss_array;
}
?>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
	<!-- Adobe recommends that developers use SWFObject2 for Flash Player detection. -->
	<!-- For more information see the SWFObject page at Google code (http://code.google.com/p/swfobject/). -->
	<!-- Information is also available on the Adobe Developer Connection Under "Detecting Flash Player versions and embedding SWF files with SWFObject 2" -->
	<!-- Set to minimum required Flash Player version or 0 for no version detection -->
	var swfVersionStr = "8.0.24";
	<!-- xiSwfUrlStr can be used to define an express installer SWF. -->
	var xiSwfUrlStr = "";
	var flashvars = {};
	var params = {};
	params.quality = "high";
	params.bgcolor = "#ffffff";
	params.play = "true";
	params.loop = "true";
	params.wmode = "window";
	params.scale = "showall";
	params.menu = "true";
	params.devicefont = "false";
	params.salign = "";
	params.allowscriptaccess = "sameDomain";
	var attributes = {};
	attributes.id = "variaveis";
	attributes.name = "variaveis";
	attributes.align = "middle";
	swfobject.createCSS("html", "height:100%; background-color: #ffffff;");
	swfobject.createCSS("body", "margin:0; padding:0; overflow:hidden; height:100%;");
	swfobject.embedSWF(
		"variaveis.swf?<?php echo 'quantidade='.$qnt.'&'.$var;?> ", "flashContent",
		"680px", "30px",
		swfVersionStr, xiSwfUrlStr,
		flashvars, params, attributes);
</script>

<!-- SWFObject's dynamic embed method replaces this alternative HTML content for Flash content when enough JavaScript and Flash plug-in support is available. -->
<div id="flashContent">
	<a href="http://www.adobe.com/go/getflash">
		<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
	</a>
	<p>Esta página requer o Flash Player versão 8.0.24 ou superior.</p>
</div>